﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage_admin.master"
    AutoEventWireup="true" CodeFile="DonViNhaChoThue.aspx.cs" Inherits="admin_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuHai" runat="Server">
    <!-- menu trong cap thu muc -->
    <div class="nav2">
        <ul>
            <li class="first"><a href="/admin/systemmanager.aspx" class="menu-nha-dat">Menu Nhà
                Đất</a></li>
            <li><a href="/admin/menunhachothue.aspx" class="menu-nha-cho-thue">Menu Nhà Cho Thuê</a></li>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <li><a href="/admin/menucanmua.aspx" class="menu-can-mua">Menu Cần Mua</a></li>
            <li><a href="/admin/menucanthue.aspx" class="menu-can-thue">Menu Cần Thuê</a></li>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <li><a href="/admin/donvinhadat.aspx" class="don-vi-nha-dat">ĐVT Nhà Đất</a></li>
            <li><a href="/admin/donvinhachothue.aspx" class="don-vi-nha-cho-thue">ĐVT Nhà Cho Thuê</a></li>
        </ul>
        <br class="clear">
    </div>
    <!-- end menu trong cap thu muc -->
    <div class="clear">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server">
    <div>
        <h2>
            Thêm Mới Danh Mục Đơn Vị Nhà Cho Thuê</h2>
        <table class="style1">
            <tr>
                <td class="style2">
                    Tên đơn vị nhà cho thuê:
                </td>
                <td>
                    <asp:TextBox ID="TxtTen" runat="server" MaxLength="100"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtTen"
                        Display="Dynamic" ErrorMessage="Tên đơn vị nhà cho thuê không được trống" SetFocusOnError="True"
                        ValidationGroup="insert"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="BtnInsert" runat="server" Text="Thêm" ValidationGroup="insert" Width="65px"
                        OnClick="BtnInsert_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div class="clear">
    </div>
    <h2>
        Danh Sách Danh Mục Đơn Vị Nhà Cho Thuê</h2>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3"
        GridLines="Vertical" Width="1114px" OnRowCancelingEdit="GridView1_RowCancelingEdit"
        OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating"
        BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
        DataKeyNames="ID">
        <AlternatingRowStyle BackColor="#DCDCDC" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="Mã" ReadOnly="True">
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="60px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Tên Đơn Vị Nhà Cho Thuê">
                <EditItemTemplate>
                    <asp:TextBox ID="TBTen" runat="server" Height="15px" MaxLength="120" Text='<%# Bind("Ten") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TBTen"
                        Display="None" ErrorMessage="Tên đơn vị nhà cho thuê không được bỏ trống" ValidationGroup="updatenh"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Ten") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:TemplateField>
                <EditItemTemplate>
                    <asp:Button ID="btnUpdate" runat="server" CausesValidation="True" CommandName="Update"
                        Text="Cập Nhật" ValidationGroup="updatenh" />
                    &nbsp;<asp:Button ID="btnCancle" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="Cancel" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Button ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit"
                        Text="Sửa" />
                    &nbsp;<asp:Button ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                        OnClientClick="return confirm(&quot;Bạn có thực sự muốn xóa?&quot;);" Text="Xóa" />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="150px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#0000A9" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#000065" />
    </asp:GridView>
</asp:Content>
